home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / dev / misc / BoulderEngine.lha / BOULDER_feb_12.lha / RND.C < prev    next >
Encoding:
Text File  |  1980-01-01  |  485 b   |  31 lines

  1. /* RND generatorius */
  2. #asm
  3.    blanks off
  4.    section code
  5.    xdef _rnd
  6. _rnd  lea   rndseed,a0
  7.       move.l   4(sp),d1
  8.       tst.l d1
  9.       ble.s setseed
  10.       move.l   (a0),d0
  11.       ADD.L d0,d0
  12.       BHI.S over
  13.       EORI.L   #$1D872B41,d0
  14. over
  15.       move.l d0,(a0)
  16.       andi.l   #$FFFF,d0
  17.       andi.l   #$FFFF,d1
  18.       divu  d1,d0
  19.       swap  d0
  20.       ext.l d0
  21.       rts
  22. setseed  neg.l d1
  23.       move.l   d1,(a0)
  24.       rts
  25.  
  26.    section data
  27. rndseed  dc.l  40
  28.    section code
  29. #endasm
  30.  
  31.